/*
 * @Author: yanjikun
 * @Date: 2022-05-12 11:52:03
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-05-12 14:25:50
 * @Description: file content
 */

import { CSSProperties, VNode } from 'vue'

/** 获取所有字段名 */
export type GetFieldKeys<T> = Exclude<keyof T, symbol | number>

export interface CallbackParams<T = any> {
  value: any
  fields: T
}

export interface DescriptionsConfig<T = any> {
  /**字段名 */
  field: T extends string ? string : GetFieldKeys<T>
  /**内容描述 */
  label: string | VNode | JSX.Element
  slot?: string
  span?: number
  labelStyle?: CSSProperties
  bodyCell?: (params: CallbackParams<T>) => VNode | string
  show?: boolean | ((params: CallbackParams<T>) => boolean)
}
